package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author Pan Rundong
 * @Date 2023-02-25 21:02
 * @Desc 用户详细信息Mapper
 */
@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    /**
     * 分页查询
     *
     * @param pageInfo
     * @param userId
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.tanhua.model.domain.UserInfo>
     * @Author: Pan Rundong
     */
    @Select("select tui.*\n" +
            "from tb_black_list tbb,\n" +
            "     tb_user_info tui\n" +
            "where tbb.black_user_id = tui.id\n" +
            "  and tbb.user_id =#{userId};")
    Page<UserInfo> getPage(@Param("pages") Page<UserInfo> pageInfo, Long userId);
}
